<template>
    <ul>
        <li v-for="(item,index) in arr " :key="index">
            {{item}}
            <button @click="btn1(index)">删除</button>
        </li>
        <button @click="btn2">生成</button>
    </ul>
</template>

<script>
    export default {
        data() {
            return {
                arr: [1, 3, 5]
            }
        },
        methods: {
            btn1(ind) {
                this.arr.splice(ind, 1)
            },
            btn2() {

                this.arr.push(Math.floor(Math.random() * 99))

            }
        }
    }
</script>

<style>

</style>